<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>我的书单-My Books</title>
</head>
<body>
    <header>
        <h2>书是智慧的量尺</h2>
    </header>
    <div th:if="${user == null}">
        <a href="/login">登录</a>
        <a href="/register">注册</a>
    </div>
    <div th:if="${user != null}">
        <label th:text="'当前登录人:' + ${user.username}"></label>
        <a href="/books/">我的书单</a>
        <a href="/logout">退出</a>
        <hr/>
        <!--显示共享书单-->
        <div th:if="#{list.isEmpty(books) == false}">
            <label> 共享书单 </label>
            <dl th:each="book:${books}">
                <dt><a th:href="${book.saleUrl}" th:text="${book.name}" target="_blank">购买</a></dt>
                <dd th:text="${book.author}">作者</dd>
                <dd th:text="${book.description}">描述</dd>
                <dd th:text="${book.publisher}">出版设</dd>
                <dd th:text="'由' + ${book.creatoruid} + '分享'">分享人</dd>
            </dl>
        </div>
    </div>
    <footer>
        我们一直在努力
    </footer>
</body>
</html>